package kr.hkit.androidcomplete01.ch04;

import kr.hkit.androidcomplete01_.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class ButtonAndEditText extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.buttonandedittext);
		
		Button btn = (Button) findViewById(R.id.btn);
	btn.setOnClickListener(new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			EditText ex = (EditText) findViewById(R.id.edit);
			String text = ex.getText().toString();
			Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();
		}
	});
	
	}
	
}
